﻿$("#PageSizeFilter").live("change", function () {
    ShowList();
});

function ShowList() {
    $("#List").mask(loadingMessage + "...");
    var ascDirection;
    if (lastSortDirection == 'asc')
        ascDirection = true;
    else
        ascDirection = false;

    $.ajax(
        {
            url: $Url.resolve("~/Provider/List"),
            data: { sortColumn: lastSortColumn, sortAscending: ascDirection, pageSize: $("#PageSizeFilter").val() },
            type: "GET",
            cache: false,
            success: function (result) {
                $("#List").unmask();
                $("#List").html(result);
            },
            complete: function (xhr, status, err) {
                if (status == "error") {
                    $("#List").unmask();
                    handleGlobalError(xhr, status, err);
                }
            }
        });
}
